<template>
  <div>
    <a-card :bordered="false">
      <f-search-form :more="false" @searchHandler="searchHandler">
        <f-search-form-item label="模块名称" name="model"/>
        <f-search-form-item label="请求内容" name="req"/>
      </f-search-form>
      <f-table ref="table" rowKey="srmApiLogId"
               :columns="columns"
               :exportBtn="true"
               :multiple="false"
               :operator="operator"
               :params="queryParam"
               :api="api.srmApiLog"
               bordered
               :scroll="{ x: 1300, y: 500 }"
      >
<!--        <span slot="action" slot-scope="text, record">-->
<!--          <template>-->
<!--            <a @click="$refs.drawer.showDrawer(record)">编辑</a>-->
<!--            <a-divider type="vertical"/>-->
<!--          </template>-->
<!--          <a-dropdown>-->
<!--            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>-->
<!--            <a-menu slot="overlay">-->
<!--              <a-menu-item v-if="$auth('table.delete')">-->
<!--                <a href="javascript:;" @click="$refs.table.del(record)">删除</a>-->
<!--              </a-menu-item>-->
<!--            </a-menu>-->
<!--          </a-dropdown>-->
<!--        </span>-->
      </f-table>
    </a-card>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'TableList',
    components: {
    },
    data() {
      let me = this
      //操作按钮
      let operator = []
      // operator.push({
      //   name: '添加',
      //   icon: 'plus',
      //   that: this,
      //   handler: function(table, that) {
      //       that.$refs.drawer.showDrawer()
      //   }
      // })
      // operator.push({
      //   name: '删除',
      //   icon: 'delete',
      //   batch: true,
      //   handler: function(table) {
      //       table.remove()
      //   }
      // })
      return {
        api:  Object.assign(api, this.api),
        //列表初始化查询参数
        queryParam: {},
        // 表头
        columns: [
          // {
          //   title: '#',
          //   width: '60',
          //   align: 'center',
          //   customRender: (text, record, index) => index + 1
          // },
          {
            title: '模块名称',
            align: 'center',
            dataIndex: 'model',
            width: 150,
            sorter: (a, b) => a.model.length - b.model.length
          },
          {
            title: '请求内容',
            align: 'center',
            dataIndex: 'req',
            sorter: (a, b) => a.req.length - b.req.length
          }
          // {
          //   title: '创建时间',
          //   align: 'center',
          //   dataIndex: 'createTime'
          // },
          // {
          //   title: '更新时间',
          //   align: 'center',
          //   dataIndex: 'updateTime'
          // },
          // {
          //   title: '操作',
          //   align: 'center',
          //   scopedSlots: { customRender: 'action' }
          // }
        ],
        operator: operator
      }
    },
    created() {
    },
    methods: {
    }
  }
</script>
